﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Domain.ActiveDirectory.Model;
using Domain.Context;

namespace WebUI.DataModel
{
    public class NMCTerritoryModel
    {
        private NMCTerritory _territory;
        private User _nmc;
        private AccountType _accountType;

        public NMCTerritoryModel()
        {
            _territory = new NMCTerritory();

            _accountType = new AccountType()
                {
                    Active = true
                };

            _nmc = new User();
            _nmc.IsActive = false;
        }

        public int ID 
        { 
            get { return _territory.NMC_UID; }
            set { _territory.NMC_UID = value; }
        }

        public String AccountTypeName
        { 
            get 
            { return _accountType.Active ? _accountType.NMC_AccountTypeName : "None"; }
            set { _accountType.NMC_AccountTypeName = value; }
        }

        public String TerritoryName
        { 
            get { return _territory.NMC_Area; }
            set { _territory.NMC_Area = value; }
        }

        public String NMCName
        {
            get { return _nmc == null || !_nmc.IsActive ? "None" : _nmc.CompleteName; }
            set { _nmc.CompleteName = value; }
        }

        public string NMCTerritoryGLAccount
        {
            get { return _territory.NMC_GL_Acct; }
            set { _territory.NMC_GL_Acct = value; }
        }

        public String LastModified
        {
            get { return _territory.LastModified; } 
        }

        public User NMC
        {
            get { return _nmc; }
            set { _nmc = value; }
        }

        public NMCTerritory Territory
        {
            get { return _territory; }
            set { _territory = value; }
        }

        public AccountType AccountType
        {
            get { return _accountType; }
            set { _accountType = value; }
        }
    }

}